<?php
       $this->setLayout('layout'.DS.'center.phtml');
       $this->startBlock();
?>
<script>
    $(function(){
        $('#sort_condition').change(function(){
            var subject_id = '<?php echo Kd_Web::getSession()->get('current_subject_id')?>';
            self.location="/article/content/subjectarticle/sort/"+$(this).val()+'/subject_id/'+subject_id;
        })
    })
</script>
<div class ="public_width subject_article_list">
    排序条件:<select id="sort_condition">
        <option value="default">默认</option>
        <option value="clickcount">点击率</option>
    </select>
    <a href="<?php echo $this->getUrl(NULL,'create','content','article')?>">创建文章</a>
    <?php foreach($this->articles as $article):?>
        <h3><?php echo $article->getTitle()?></h3>
        <ul>
            <a href="<?php echo $this->getUrl(array('id'=>$article->getId()),'edit','content','article')?>">编辑</a>
            <a href="<?php echo $this->getUrl(array('subject_id'=>$article->getId()),'subjectArticle','content','article')?>">发布</a>
            <ul style="list-style-type: none">
                <li>分类：<?php echo $article->getCategoryName()?></li>
                <li>点击量：<?php echo $article->getClickCount()?></li>
            </ul>
            <br>
         </ul>
    <?php endforeach;?>
    <?php echo $this->pagination->toHtml() ?>
</div>
<?php $this->endBlock();?>